package com.yuns.util;

import java.util.Random;

/**
 *
 * @author ASUS
 * @since 2018/11/20
 *
 */
public class MakeRound {

    /**
     * @param yzlength 验证码的长度
     * @return 验证码
     */
    public static String round(Integer yzlength){
        String str="";
        if(yzlength!=4){
            for(int i=0;i<yzlength;i++){
                str=str+new Random().nextInt(10);
            }

        }if(yzlength<=0){
            try {
                throw new Exception("请输入正确的数据");
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return str;
    }
}
